* Generate LAPOP Dataset

*Start with El Salvador

use "/Users/gviscont/Dropbox/Anti-american attitudes/01_data/raw_data/381267663ElSalvador LAPOP AmericasBarometer 2016 V1.0_W.dta", clear

*Merging with Venezuela

merge 1:1 pais uniq_id using "/Users/gviscont/Dropbox/Anti-american attitudes/01_data/raw_data/25258094Venezuela LAPOP AmericasBarometer 2016-17 V1.0_W.dta"

rename _merge merge1

save "/Users/gviscont/Desktop/El Salvador + Venezuela.dta"

*Merging El Salvador and Venezuela with Paraguay

use "/Users/gviscont/Desktop/El Salvador + Venezuela.dta", clear

merge 1:1 pais uniq_id using "/Users/gviscont/Dropbox/Anti-american attitudes/01_data/raw_data/1311870907Paraguay LAPOP AmericasBarometer 2016 V1.0 W.dta"

rename _merge merge2

save "/Users/gviscont/Desktop/El Salvador + Venezuela + Paraguay.dta"

*Merging El Salvador, Venezuela (code 16), Paraguay (code 12) with Honduras (code 4)

use  "/Users/gviscont/Desktop/El Salvador + Venezuela + Paraguay.dta", clear

merge 1:1 pais uniq_id using "/Users/gviscont/Dropbox/Anti-american attitudes/01_data/raw_data/1252173714Honduras LAPOP AmericasBarometer 2016 V1.0_W.dta"

rename _merge merge3

save "/Users/gviscont/Desktop/El Salvador + Venezuela + Paraguay + Honduras.dta"

*Merging El Salvador, Venezuela (code 16), Paraguay (code 12), Honduras (code 4) with Dominican Republic (Code 21)

use "/Users/gviscont/Desktop/El Salvador + Venezuela + Paraguay + Honduras.dta", clear

merge 1:1 pais uniq_id using "/Users/gviscont/Dropbox/Anti-american attitudes/01_data/raw_data/919009550Dominican Republic LAPOP AmericasBarometer 2016 V1.0_W.dta"

rename _merge merge4

save "/Users/gviscont/Dropbox/Anti-american attitudes/01_data/raw_data/LAPOP_five_countries_clean.dta"

